-
Notifications
You must be signed in to change notification settings - Fork 17
CLOUDP-322487 - Webhook clusterrole #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
MCK 1.3.0 Release NotesNew FeaturesMulti-Architecture SupportWe've added comprehensive multi-architecture support for the kubernetes operator. This enhancement enables deployment on IBM Power (ppc64le) and IBM Z (s390x) architectures alongside
Bug Fixes
Other Changes
|
@@ -1,12 +1,13 @@ | |||
|
|||
{{/* This cluster role and binding is necessary to allow the operator to automatically register ValidatingWebhookConfiguration. */}} | |||
{{- if and .Values.operator.webhook.registerConfiguration .Values.operator.webhook.installClusterRole }} | |||
{{- if not (lookup "rbac.authorization.k8s.io/v1" "ClusterRole" "" "mongodb-kubernetes-operator-mongodb-webhook") }} | |||
{{- $webhookClusterRoleName := printf "%s-%s-webhook-cr" .Values.operator.name (include "mongodb-kubernetes-operator.namespace" .) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've changed both names, because one was dynamic and one not - causing upgrade problems. Now both are just a new set of names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this test verify that subsequent upgrades of the chart does not break the rbac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no - we only have e2e tests that verify latest (1.2.0) -> current (code build) and those are passing.
We don't have current -> current, but I don't see how this could be failing, do you think we should test this in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should have a test in our CI that upgrades the released helm chart version to the current local version to test things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we only have e2e tests that verify latest (1.2.0) -> current (code build) and those are passing.
isn't that exactly that - or are we talking about different things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its operator_upgrade_ops_manager
we have suite of those
mongodb-kubernetes/docker/mongodb-kubernetes-tests/tests/upgrades/operator_upgrade_ops_manager.py
Line 148 in f29ac63
operator = get_default_operator( |
Summary
This pull request introduces Helm chart unit tests to the CI pipeline and ensures consistent naming for ClusterRole and ClusterRoleBinding resources in the Helm chart. The most important changes are grouped below:
Helm Chart Testing Integration:
Added a
helm-tests
target to theMakefile
to run Helm chart unit tests using thehelm-unittest
plugin. The target installs the plugin if necessary and runs tests in thehelm_chart
directory.Created a
test_helm_unit
function in.evergreen-functions.yml
to execute the new Helm unit tests as part of CI.Added a
unit_tests_helm
task to.evergreen.yml
and included it in theunit_tests_task_group
to ensure Helm unit tests run with other unit tests in the CI pipeline.Helm Chart Improvements and Testing:
Updated
operator-roles-webhook.yaml
to dynamically generate consistent names for ClusterRole and ClusterRoleBinding resources based on the operator name and namespace, preventing naming conflicts across multiple installations.Added a new Helm unit test suite (
webhook_clusterrole_test.yaml
) to verify that ClusterRole and ClusterRoleBinding names are consistent and unique per installation.Example
the new names:
binding
<name>-<ns>-webhook-crb
role
<name>-<ns>-webhook-cr
old names:
binding
<name>-<ns>-webhook
role
mongodb-kubernetes-operator-mongodb-webhook
Proof of Work
Checklist
skip-changelog
label if not needed